﻿using ProTrack.Dto;
using ProTrack.Entity;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ProTrack.IServices.Product
{
    public interface IItemServices
    {
        /// <summary>
        ///获取产品数据
        /// </summary>
        /// <returns></returns>
        public Task<IEnumerable<Item>> GetAllAsync();


        /// <summary>
        /// 获取产品总条数
        /// </summary>
        /// <param name="ItemCode">产品物料编码</param>
        /// <param name="ItemName">产品物料名称</param>
        /// <returns></returns>
        public Task<int> GetCountAsync(string ItemCode, string ItemName, int ItemTypeId);

        /// <summary>
        /// 根据页面获取产品数据
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="ItemTypeName">分类名称</param>
        /// <param name="ItemCode">产品物料编码</param>
        /// <param name="ItemName">产品物料名称</param>
        /// <returns></returns>
        public Task<IEnumerable<Item>> GetAsync(int PageIndex, int PageSize, string ItemCode, string ItemName,int ItemTypeId);
        public Task<IEnumerable<ItemDto>> GetItemStockAsync(int PageIndex, int PageSize, string ItemCode, string ItemName,int ItemTypeId, int WareHouseId);
        public Task<int> GetItemStockCountAsync(string ItemCode, string ItemName, int ItemTypeId, int WareHouseId);




        /// <summary>
        /// 根据产品Id 获取 BOM组成
        /// </summary>
        /// <param name="ItemId"></param>
        /// <returns></returns>
        public Task<IEnumerable<ProductBom>> GetProductBombyIdAsync(string ItemId);

        /// <summary>
        /// 修改产品
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public Task<bool> UpdateAsync(Item model, List<ProductBom> list);
        /// <summary>
        /// 新增产品
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public  Task<bool> AddAsync(Item model, List<ProductBom> list);
        /// <summary>
        /// 批量删除产品
        /// </summary>
        /// <param name="Ids"></param>
        /// <returns></returns>
        public Task<bool> DeleteAsync(int[] Ids);
        /// <summary>
        /// 删除产品
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public Task<bool> DeleteAsync(int Id);
    }
}
